<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
  </head>
  <body>
    <script>
      const info = {
        name: "jack",
        age: 20,
        height: 100,
        width: 200,
      };

      for (let k in info) {
        console.log(k);
      }

      // for in 1
      {
        let k = "name";
        console.log(k);
      }
      // for in 2
      {
        let k = "age";
        console.log(k);
      }
      // for in 3
      {
        let k = "height";
        console.log(k);
      }
      // for in 4
      {
        let k = "width";
        console.log(k);
      }
      // // 遍历输出
      // console.log(info["name"]);
      // console.log(info["age"]);
      // console.log(info["height"]);
      // console.log(info["width"]);
    </script>
  </body>
</html>
